//
//  MineTestViewController.swift
//  iOSProjectExtensionSwift
//
//  Created by HBGG on 2020/9/4.
//  Copyright © 2020 lidianchao. All rights reserved.
//

import UIKit

class MineTestViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let field = UITextField.createBaseTextField(frame: CGRect(x: 20, y: 100, width: 300, height: 44), placeHold: "测试的")
        field.addCorner()
        field.addLeftTitle(leftTitle: "密码：")
        self.view.addSubview(field)
        
        let field1 = UITextField.createBaseTextField(frame: CGRect(x: 20, y: 150, width: 300, height: 44), placeHold: "测试的")
        field1.addBottomLine()
        field1.addLeftImage(leftImage: UIImage(named: "Login_pwd_left")!, imageSize: CGSize(width: 14, height: 14))
        self.view.addSubview(field1)
        
        let field2 = UITextField.createImageCodeTextField(frame: CGRect(x: 20, y: 200, width: 300, height: 44), placeHold: "测试的", target: self,action: #selector(aotuImgTap))
        field2.addBottomLine()
        self.view.addSubview(field2)
        
        let field3 = UITextField.createMsgCodeTextField(frame: CGRect(x: 20, y: 250, width: 300, height: 44), placeHold: "发送验证码",target: self,action: #selector(sendMsg))
        field3.addCorner()
        self.view.addSubview(field3)
        
        field3.viewX = 0
        field3.viewY = 300
        field3.viewWidth = DeviceWidth
        field3.viewHeight = 80
        // Do any additional setup after loading the view.
    }
    @objc func aotuImgTap(button:UIButton) {
        button.kf.setBackgroundImage(with: URL(string: kGetImgCode_UrlRandom), for: .normal)
    }
    @objc func sendMsg(button:UIButton) {
        TimeCountDown.openCountDown(count: 10, event: { (count) in
            button.titleLabel?.text = "\(count)后重新获取"
            button.isUserInteractionEnabled = false
        }) {
            button.titleLabel?.text = "重新获取验证码"
            button.isUserInteractionEnabled = true
        }
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
